package com.appwoo.txtws.activity;

import android.R.integer;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.app.PendingIntent;
import android.app.PendingIntent.CanceledException;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.location.Location;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.provider.Settings.Secure;
import android.view.ContextThemeWrapper;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationUtils;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.DatePicker;
import android.widget.DatePicker.OnDateChangedListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RadioButton;
import android.widget.TextView;
import android.widget.Toast;
import com.appwoo.android.exception.NotFoundNetWorkException;
import com.appwoo.android.exception.TimeOutException;
import com.appwoo.txtws.bean.HistoryBean;
import com.appwoo.txtws.bean.ServerAppBean.MyGeneralListener;
import com.appwoo.txtws.bean.StateBean;
import com.appwoo.txtws.component.GetDateTime;
import com.appwoo.txtws.component.Logger;
import com.appwoo.txtws.component.RqSP;
import com.appwoo.txtws.service.LoginService;
import com.appwoo.txtws.service.WebService;
import com.baidu.location.BDLocation;
import com.baidu.location.BDLocationListener;
import com.baidu.location.LocationClient;
import com.baidu.location.LocationClientOption;
import com.baidu.mapapi.BMapManager;
import com.baidu.mapapi.GeoPoint;
import com.baidu.mapapi.ItemizedOverlay;
import com.baidu.mapapi.LocationListener;
import com.baidu.mapapi.MKAddrInfo;
import com.baidu.mapapi.MKBusLineResult;
import com.baidu.mapapi.MKDrivingRouteResult;
import com.baidu.mapapi.MKGeneralListener;
import com.baidu.mapapi.MKGeocoderAddressComponent;
import com.baidu.mapapi.MKLocationManager;
import com.baidu.mapapi.MKPoiInfo;
import com.baidu.mapapi.MKPoiResult;
import com.baidu.mapapi.MKSearch;
import com.baidu.mapapi.MKSearchListener;
import com.baidu.mapapi.MKSuggestionResult;
import com.baidu.mapapi.MKTransitRouteResult;
import com.baidu.mapapi.MKWalkingRouteResult;
import com.baidu.mapapi.MapActivity;
import com.baidu.mapapi.MapController;
import com.baidu.mapapi.MapView;
import com.baidu.mapapi.MapView.LayoutParams;
import com.baidu.mapapi.MyLocationOverlay;
import com.baidu.mapapi.OverlayItem;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import org.xmlpull.v1.XmlPullParserException;

public class TxtwebActivity extends MapActivity
  implements View.OnClickListener, View.OnTouchListener, AdapterView.OnItemClickListener, Animation.AnimationListener
{
  private static final int ANIMATION_DURATION = 500;
  private static boolean isExit;
  private static boolean isOpen;
  private String alertString;
  private Animation animHide;
  private Animation animShow;
  private Animation animSlowHide;
  private double bLat;
  private double bLng;
  private List<GeoPoint> babyPoints2;
  private List<GeoPoint> babypoints;
  private View[] babypopview;
  String bid;
  int currentViewNum = -10;
  private double dLat = 25.040255500000001D;
  private double dLng = 121.512377D;
  private View desView;
  public AlertDialog.Builder dialogquery;
  String equipType;
  int first = 1;
  private List<HistoryBean> hisAddList;
  private List<HistoryBean> hisBeanList;
  private List<HistoryBean> hisBeanList1;
  String[] hislistAddress;
  String[] hislistTime;
  private int isFind = 0;
  private BMapManager lBMapMan = null;
  private LinearLayout linear_map_andidian;
  private LinearLayout linear_map_anshijian;
  private LinearLayout linear_map_click;
  private LinearLayout linear_map_close;
  private LinearLayout linear_map_guiji;
  private LinearLayout linear_map_menu;
  private LinearLayout linear_map_switch;
  private LinearLayout linear_map_switch_close;
  private Animation listHide;
  private StateBean loc_bean;
  private String locationSwitch = "开启定位";
  private LoginService loginService;
  private BDLocation mBDLocation;
  private double mLat = 24.484459999999999D;
  private double mLng = 118.18170000000001D;
  private LocationClient mLocationClient = null;
  LocationListener mLocationListener = null;
  MyLocationOverlay mLocationOverlay;
  MapController mMapController;
  private MapView mMapView;
  private TextView map_adress;
  Drawable marker;
  int menuclick = 0;
  private MKSearch mkSearch;
  private Location myLocation;
  private List<OverlayItem> overList;
  private OverlayItem overlayItem;
  private String pos;
  private RadioButton post1;
  private RadioButton post2;
  private View ppview;
  private String qinzistatus;
  StringBuffer sb;
  Animation scale;
  Handler tExit = new Handler();
  Thread task = new Thread()
  {
    public void run()
    {
      TxtwebActivity.isExit = false;
    }
  };
  String timequery;
  String username;
  private ImageView v_imageshut;
  private ListView v_listview;
  private ImageView v_textview_back;
  private TextView v_textview_locate;
  private TextView v_textview_locate_me;
  private TextView v_textview_locate_target;
  private TextView v_textview_locate_weixing;

  private String addCMD(String paramString1, String paramString2, String paramString3, String paramString4)
  {
    this.alertString = "";
    try
    {
      StateBean localStateBean = this.loginService.addLocationCMD(paramString2, paramString3, paramString1, paramString4, this);
      if ((localStateBean.getCode() != null) && (localStateBean.getCode().equals("0")));
      for (this.alertString = localStateBean.getCode(); ; this.alertString = localStateBean.getDesc())
        return this.alertString;
    }
    catch (IOException localIOException)
    {
      while (true)
        this.alertString = getString(2131427524);
    }
    catch (XmlPullParserException localXmlPullParserException)
    {
      while (true)
        this.alertString = getString(2131427524);
    }
    catch (TimeOutException localTimeOutException)
    {
      while (true)
        this.alertString = getString(2131427526);
    }
    catch (NotFoundNetWorkException localNotFoundNetWorkException)
    {
      while (true)
      {
        localNotFoundNetWorkException.getClass();
        this.alertString = "没有连接到网络";
      }
    }
  }

  private void addView(int paramInt, String paramString, boolean paramBoolean)
  {
    this.mMapView.removeView(this.ppview);
    this.ppview = getLayoutInflater().inflate(2130903172, null);
    TextView localTextView = (TextView)this.ppview.findViewById(2131493353);
    if ((paramBoolean) && (((HistoryBean)this.hisAddList.get(paramInt)).getUpdateTime().split(" ").length > 6))
      localTextView.getLayoutParams().width = 310;
    localTextView.setText(paramString);
    Animation localAnimation = AnimationUtils.loadAnimation(this, 2130968586);
    this.ppview.startAnimation(localAnimation);
    localTextView.setVisibility(0);
    GeoPoint localGeoPoint = new GeoPoint((int)(1000000.0D * Double.parseDouble(((HistoryBean)this.hisAddList.get(paramInt)).getLatitude())), (int)(1000000.0D * Double.parseDouble(((HistoryBean)this.hisAddList.get(paramInt)).getLongitude())));
    this.mMapView.addView(this.ppview, new MapView.LayoutParams(-2, -2, localGeoPoint, 81));
    this.ppview.setOnTouchListener(new View.OnTouchListener()
    {
      public boolean onTouch(View paramAnonymousView, MotionEvent paramAnonymousMotionEvent)
      {
        switch (paramAnonymousMotionEvent.getAction())
        {
        default:
          return false;
        case 0:
        }
        TxtwebActivity.this.ppview.setVisibility(8);
        return true;
      }
    });
    this.currentViewNum = paramInt;
  }

  private void animHideLocateItem()
  {
    this.v_textview_locate_me.startAnimation(this.animHide);
    this.v_textview_locate_target.startAnimation(this.animHide);
    this.v_textview_locate_weixing.startAnimation(this.animHide);
  }

  private void animSlowHideLocateItem()
  {
    this.v_textview_locate_me.startAnimation(this.animSlowHide);
    this.v_textview_locate_target.startAnimation(this.animSlowHide);
    this.v_textview_locate_weixing.startAnimation(this.animSlowHide);
  }

  private void getAddressHistory(List<HistoryBean> paramList)
  {
    if (paramList.size() == 0)
    {
      Toast.makeText(this, "(" + this.timequery + ")" + getString(2131427968), 1).show();
      return;
    }
    this.currentViewNum = -10;
    this.mMapView.removeView(this.ppview);
    getHisNowList(paramList);
    int m;
    int i;
    if ((this.babyPoints2.size() > 0) && (this.babypopview != null))
    {
      m = 0;
      if (m < this.babypopview.length);
    }
    else
    {
      this.babypopview = new View[this.hisAddList.size()];
      i = 1;
    }
    for (int j = 0; ; j++)
    {
      if (j >= this.hisAddList.size())
      {
        GeoPoint localGeoPoint1 = new GeoPoint((int)(1000000.0D * Double.parseDouble(((HistoryBean)this.hisBeanList.get(0)).getLatitude())), (int)(1000000.0D * Double.parseDouble(((HistoryBean)this.hisBeanList.get(0)).getLongitude())));
        this.mMapController.animateTo(localGeoPoint1);
        showDidian();
        return;
        this.mMapView.removeView(this.babypopview[m]);
        m++;
        break;
      }
      final int k = j;
      GeoPoint localGeoPoint2 = new GeoPoint((int)(1000000.0D * Double.parseDouble(((HistoryBean)this.hisAddList.get(j)).getLatitude())), (int)(1000000.0D * Double.parseDouble(((HistoryBean)this.hisAddList.get(j)).getLongitude())));
      this.babypopview[j] = getLayoutInflater().inflate(2130903171, null);
      this.mMapView.addView(this.babypopview[j], new MapView.LayoutParams(-2, -2, localGeoPoint2, 81));
      ((TextView)this.babypopview[j].findViewById(2131493352)).setText(String.valueOf(i));
      i++;
      this.babypopview[j].setOnClickListener(new View.OnClickListener()
      {
        public void onClick(View paramAnonymousView)
        {
          System.out.println("onclick");
          String str = ((HistoryBean)TxtwebActivity.this.hisAddList.get(k)).getUpdateTime() + "\n" + ((HistoryBean)TxtwebActivity.this.hisAddList.get(k)).Address;
          if (TxtwebActivity.this.currentViewNum != -10)
          {
            TxtwebActivity.this.babypopview[TxtwebActivity.this.currentViewNum].setBackgroundDrawable(TxtwebActivity.this.getResources().getDrawable(2130837655));
            TxtwebActivity.this.babypopview[TxtwebActivity.this.currentViewNum].setPadding(0, 5, 0, 0);
          }
          TxtwebActivity.this.babypopview[k].setBackgroundDrawable(TxtwebActivity.this.getResources().getDrawable(2130837518));
          TxtwebActivity.this.babypopview[k].setPadding(0, 5, 0, 0);
          TxtwebActivity.this.addView(k, str, true);
        }
      });
    }
  }

  private void getHisNowList(List<HistoryBean> paramList)
  {
    this.hisAddList = new ArrayList();
    this.hisBeanList = new ArrayList();
    this.hisBeanList = paramList;
    this.hislistTime = new String[this.hisBeanList.size()];
    int i = 0;
    if (i >= this.hisBeanList.size());
    int k;
    for (int j = 0; ; j++)
    {
      if (j >= this.hisBeanList.size())
      {
        k = 0;
        if (k < this.babypoints.size())
          break label287;
        System.out.println("hisAddList" + this.hisAddList.size() + "  hisAddList");
        return;
        this.hislistTime[i] = ((HistoryBean)this.hisBeanList.get(-1 + this.hisBeanList.size() - i)).UpdateTime;
        i++;
        break;
      }
      System.out.println("hisBeanList  meibian " + ((HistoryBean)this.hisBeanList.get(j)).getLatitude() + "  " + ((HistoryBean)this.hisBeanList.get(j)).getLongitude() + "  " + ((HistoryBean)this.hisBeanList.get(j)).getUpdateTime() + " " + ((HistoryBean)this.hisBeanList.get(j)).getAddress());
    }
    label287: int m = k + 1;
    if (m >= this.babypoints.size());
    while (true)
    {
      if (k == -1 + this.babypoints.size())
        this.hisAddList.add((HistoryBean)this.hisBeanList.get(k));
      k++;
      break;
      if ((!((HistoryBean)this.hisBeanList.get(k)).getLatitude().equals(((HistoryBean)this.hisBeanList.get(m)).getLatitude())) || (!((HistoryBean)this.hisBeanList.get(k)).getLongitude().equals(((HistoryBean)this.hisBeanList.get(m)).getLongitude())))
        break label691;
      ((HistoryBean)this.hisBeanList.get(m)).UpdateTime = (((HistoryBean)this.hisBeanList.get(k)).UpdateTime + " " + ((HistoryBean)this.hisBeanList.get(m)).UpdateTime);
      ((HistoryBean)this.hisBeanList.get(m)).Latitude = ((HistoryBean)this.hisBeanList.get(k)).getLatitude();
      ((HistoryBean)this.hisBeanList.get(m)).Longitude = ((HistoryBean)this.hisBeanList.get(k)).getLongitude();
      if (((HistoryBean)this.hisBeanList.get(m)).getAddress().length() > ((HistoryBean)this.hisBeanList.get(k)).getAddress().length())
        ((HistoryBean)this.hisBeanList.get(k)).Address = ((HistoryBean)this.hisBeanList.get(m)).getAddress();
      else
        ((HistoryBean)this.hisBeanList.get(m)).Address = ((HistoryBean)this.hisBeanList.get(k)).getAddress();
    }
    label691: if (m != -1 + this.babypoints.size());
    while (true)
    {
      m++;
      break;
      this.hisAddList.add((HistoryBean)this.hisBeanList.get(k));
    }
  }

  private void getHistory(List<HistoryBean> paramList)
  {
    if (paramList.size() == 0)
    {
      Toast.makeText(this, "(" + this.timequery + ")" + getString(2131427968), 1).show();
      return;
    }
    this.currentViewNum = -10;
    int m;
    int i;
    if ((this.babyPoints2.size() > 0) && (this.babypopview != null))
    {
      m = 0;
      if (m < this.babypopview.length);
    }
    else
    {
      this.mMapView.removeView(this.ppview);
      getHisNowList(paramList);
      this.babypopview = new View[this.hisAddList.size()];
      i = 1;
    }
    for (int j = 0; ; j++)
    {
      if (j >= this.hisAddList.size())
      {
        GeoPoint localGeoPoint1 = new GeoPoint((int)(1000000.0D * Double.parseDouble(((HistoryBean)this.hisAddList.get(0)).getLatitude())), (int)(1000000.0D * Double.parseDouble(((HistoryBean)this.hisAddList.get(0)).getLongitude())));
        this.mMapController.animateTo(localGeoPoint1);
        return;
        this.mMapView.removeView(this.babypopview[m]);
        m++;
        break;
      }
      final int k = j;
      GeoPoint localGeoPoint2 = new GeoPoint((int)(1000000.0D * Double.parseDouble(((HistoryBean)this.hisAddList.get(j)).getLatitude())), (int)(1000000.0D * Double.parseDouble(((HistoryBean)this.hisAddList.get(j)).getLongitude())));
      this.babypopview[j] = getLayoutInflater().inflate(2130903171, null);
      this.mMapView.addView(this.babypopview[j], new MapView.LayoutParams(-2, -2, localGeoPoint2, 81));
      ((TextView)this.babypopview[j].findViewById(2131493352)).setText(String.valueOf(i));
      i++;
      this.babypopview[j].setOnClickListener(new View.OnClickListener()
      {
        public void onClick(View paramAnonymousView)
        {
          System.out.println("onclick");
          String str = ((HistoryBean)TxtwebActivity.this.hisAddList.get(k)).getUpdateTime() + "\n" + ((HistoryBean)TxtwebActivity.this.hisAddList.get(k)).Address;
          if (TxtwebActivity.this.currentViewNum != -10)
          {
            TxtwebActivity.this.babypopview[TxtwebActivity.this.currentViewNum].setBackgroundDrawable(TxtwebActivity.this.getResources().getDrawable(2130837655));
            TxtwebActivity.this.babypopview[TxtwebActivity.this.currentViewNum].setPadding(0, 5, 0, 0);
          }
          TxtwebActivity.this.babypopview[k].setBackgroundDrawable(TxtwebActivity.this.getResources().getDrawable(2130837518));
          TxtwebActivity.this.babypopview[k].setPadding(0, 5, 0, 0);
          TxtwebActivity.this.addView(k, str, true);
        }
      });
    }
  }

  private void getTimeHistory(List<HistoryBean> paramList)
  {
    if (paramList.size() == 0)
    {
      Toast.makeText(this, "(" + this.timequery + ")" + getString(2131427968), 1).show();
      return;
    }
    this.currentViewNum = -10;
    this.mMapView.removeView(this.ppview);
    getHisNowList(paramList);
    int m;
    int i;
    if ((this.babyPoints2.size() > 0) && (this.babypopview != null))
    {
      m = 0;
      if (m < this.babypopview.length);
    }
    else
    {
      this.babypopview = new View[this.hisAddList.size()];
      i = 1;
    }
    for (int j = 0; ; j++)
    {
      if (j >= this.hisAddList.size())
      {
        GeoPoint localGeoPoint1 = new GeoPoint((int)(1000000.0D * Double.parseDouble(((HistoryBean)this.hisBeanList.get(0)).getLatitude())), (int)(1000000.0D * Double.parseDouble(((HistoryBean)this.hisBeanList.get(0)).getLongitude())));
        this.mMapController.animateTo(localGeoPoint1);
        showShijian();
        return;
        this.mMapView.removeView(this.babypopview[m]);
        m++;
        break;
      }
      final int k = j;
      GeoPoint localGeoPoint2 = new GeoPoint((int)(1000000.0D * Double.parseDouble(((HistoryBean)this.hisAddList.get(j)).getLatitude())), (int)(1000000.0D * Double.parseDouble(((HistoryBean)this.hisAddList.get(j)).getLongitude())));
      this.babypopview[j] = getLayoutInflater().inflate(2130903171, null);
      this.mMapView.addView(this.babypopview[j], new MapView.LayoutParams(-2, -2, localGeoPoint2, 81));
      ((TextView)this.babypopview[j].findViewById(2131493352)).setText(String.valueOf(i));
      i++;
      this.babypopview[j].setOnClickListener(new View.OnClickListener()
      {
        public void onClick(View paramAnonymousView)
        {
          System.out.println("onclick");
          String str = ((HistoryBean)TxtwebActivity.this.hisAddList.get(k)).getUpdateTime() + "\n" + ((HistoryBean)TxtwebActivity.this.hisAddList.get(k)).Address;
          if (TxtwebActivity.this.currentViewNum != -10)
          {
            TxtwebActivity.this.babypopview[TxtwebActivity.this.currentViewNum].setBackgroundDrawable(TxtwebActivity.this.getResources().getDrawable(2130837655));
            TxtwebActivity.this.babypopview[TxtwebActivity.this.currentViewNum].setPadding(0, 5, 0, 0);
          }
          TxtwebActivity.this.babypopview[k].setBackgroundDrawable(TxtwebActivity.this.getResources().getDrawable(2130837518));
          TxtwebActivity.this.babypopview[k].setPadding(0, 5, 0, 0);
          TxtwebActivity.this.addView(k, str, true);
        }
      });
    }
  }

  private void hideLocateItem()
  {
    this.v_textview_locate_me.setVisibility(4);
    this.v_textview_locate_target.setVisibility(4);
    this.v_textview_locate_weixing.setVisibility(8);
  }

  private void init()
  {
    if (!isGPSEnable())
      switchGps();
    this.scale = AnimationUtils.loadAnimation(this, 2130968586);
    this.marker = getResources().getDrawable(2130837772);
    this.babypoints = new ArrayList();
    this.babyPoints2 = new ArrayList();
    this.overList = new ArrayList();
    this.map_adress = ((TextView)findViewById(2131493203));
    this.v_listview = ((ListView)findViewById(2131493202));
    this.v_imageshut = ((ImageView)findViewById(2131493201));
    this.v_textview_back = ((ImageView)findViewById(2131493195));
    this.v_textview_back.setOnClickListener(this);
    this.v_textview_locate = ((TextView)findViewById(2131493196));
    this.v_textview_locate.setOnClickListener(this);
    this.v_textview_locate_me = ((TextView)findViewById(2131493198));
    this.v_textview_locate_me.setOnClickListener(this);
    this.v_textview_locate_target = ((TextView)findViewById(2131493199));
    this.v_textview_locate_target.setOnClickListener(this);
    this.v_textview_locate_weixing = ((TextView)findViewById(2131493200));
    this.v_textview_locate_weixing.setOnClickListener(this);
    this.animShow = new AlphaAnimation(0.0F, 100.0F);
    this.animShow.setDuration(500L);
    this.animShow.setAnimationListener(this);
    this.animHide = new AlphaAnimation(100.0F, 0.0F);
    this.animHide.setDuration(200L);
    this.animHide.setAnimationListener(this);
    this.animSlowHide = new AlphaAnimation(100.0F, 0.0F);
    this.animSlowHide.setDuration(4000L);
    this.animSlowHide.setAnimationListener(this);
    this.listHide = new AlphaAnimation(10.0F, 0.0F);
    this.listHide.setDuration(500L);
    this.listHide.setAnimationListener(this);
    this.linear_map_click = ((LinearLayout)findViewById(2131493204));
    this.linear_map_click.setOnClickListener(this);
    this.linear_map_menu = ((LinearLayout)findViewById(2131493205));
    this.linear_map_close = ((LinearLayout)findViewById(2131493206));
    this.linear_map_close.setOnClickListener(this);
    this.linear_map_switch = ((LinearLayout)findViewById(2131493207));
    this.linear_map_switch.setOnClickListener(this);
    this.linear_map_switch_close = ((LinearLayout)findViewById(2131493208));
    this.linear_map_switch_close.setOnClickListener(this);
    this.linear_map_guiji = ((LinearLayout)findViewById(2131493209));
    this.linear_map_guiji.setOnClickListener(this);
    this.linear_map_anshijian = ((LinearLayout)findViewById(2131493210));
    this.linear_map_anshijian.setOnClickListener(this);
    this.linear_map_andidian = ((LinearLayout)findViewById(2131493211));
    this.linear_map_andidian.setOnClickListener(this);
  }

  private boolean isGPSEnable()
  {
    boolean bool = Settings.Secure.isLocationProviderEnabled(getContentResolver(), "gps");
    System.out.println("getGpsState:" + bool);
    return bool;
  }

  private void locaReg()
  {
    this.lBMapMan.getLocationManager().requestLocationUpdates(this.mLocationListener);
    this.mkSearch.init(this.lBMapMan, new MySearchListener());
    this.mLocationOverlay = new MyLocationOverlay(this, this.mMapView)
    {
      protected boolean dispatchTap()
      {
        TxtwebActivity.this.mkSearch.reverseGeocode(new GeoPoint((int)(1000000.0D * TxtwebActivity.this.myLocation.getLatitude()), (int)(1000000.0D * TxtwebActivity.this.myLocation.getLongitude())));
        return super.dispatchTap();
      }

      public boolean onTap(GeoPoint paramAnonymousGeoPoint, MapView paramAnonymousMapView)
      {
        TxtwebActivity.this.map_adress.setVisibility(4);
        return super.onTap(paramAnonymousGeoPoint, paramAnonymousMapView);
      }
    };
    this.mMapView.getOverlays().add(this.mLocationOverlay);
    this.mLocationOverlay.enableMyLocation();
    this.mLocationOverlay.enableCompass();
    if (this.lBMapMan != null)
      this.lBMapMan.start();
    new LocationAsyncTask().execute(new String[] { "islocation" });
    if (this.equipType.equals("Android"))
      new LocationAsyncTask().execute(new String[] { "location" });
    if (isOpen)
    {
      this.linear_map_switch.setVisibility(8);
      this.linear_map_switch_close.setVisibility(0);
    }
    while (true)
    {
      com.appwoo.txtws.component.Global.isManageGps = true;
      return;
      this.linear_map_switch.setVisibility(0);
      this.linear_map_switch_close.setVisibility(8);
    }
  }

  private void showLocateItem()
  {
    this.v_textview_locate_me.setVisibility(0);
    this.v_textview_locate_target.setVisibility(0);
    this.v_textview_locate_weixing.setVisibility(0);
  }

  private void showLocateItemNow()
  {
    showLocateItem();
    animSlowHideLocateItem();
  }

  private void switchGps()
  {
    Intent localIntent = new Intent();
    localIntent.setClassName("com.android.settings", "com.android.settings.widget.SettingsAppWidgetProvider");
    localIntent.addCategory("android.intent.category.ALTERNATIVE");
    localIntent.setData(Uri.parse("custom:3"));
    try
    {
      PendingIntent.getBroadcast(this, 0, localIntent, 0).send();
      return;
    }
    catch (PendingIntent.CanceledException localCanceledException)
    {
      localCanceledException.printStackTrace();
    }
  }

  protected void LocateWayDialog(Context paramContext)
  {
    View localView = getLayoutInflater().inflate(2130903187, null);
    final Dialog localDialog = new Dialog(paramContext, 2131361814);
    localDialog.setContentView(localView);
    this.post1 = ((RadioButton)localView.findViewById(2131493446));
    this.post2 = ((RadioButton)localView.findViewById(2131493447));
    TextView localTextView = (TextView)localView.findViewById(2131493448);
    ((TextView)localView.findViewById(2131493449)).setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        localDialog.dismiss();
      }
    });
    localTextView.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        localDialog.dismiss();
        if (TxtwebActivity.this.post1.isChecked())
          TxtwebActivity.this.pos = "1";
        if (TxtwebActivity.this.post2.isChecked())
          TxtwebActivity.this.pos = "2";
        new TxtwebActivity.LocationAsyncTask(TxtwebActivity.this).execute(new String[] { "locationmode" });
      }
    });
    localDialog.show();
  }

  public void SetAddressByTime(int paramInt)
  {
    if (this.currentViewNum != -10)
    {
      this.babypopview[this.currentViewNum].setBackgroundDrawable(getResources().getDrawable(2130837655));
      this.babypopview[this.currentViewNum].setPadding(0, 5, 0, 0);
    }
    for (int i = -1 + this.hisAddList.size(); ; i--)
    {
      int j = 0;
      if (i < 0);
      while (true)
      {
        this.currentViewNum = j;
        return;
        if (!((HistoryBean)this.hisAddList.get(i)).UpdateTime.contains(this.hislistTime[paramInt]))
          break;
        GeoPoint localGeoPoint = new GeoPoint((int)(1000000.0D * Double.parseDouble(((HistoryBean)this.hisAddList.get(i)).getLatitude())), (int)(1000000.0D * Double.parseDouble(((HistoryBean)this.hisAddList.get(i)).getLongitude())));
        this.mMapView.removeView(this.babypopview[i]);
        this.mMapView.addView(this.babypopview[i], new MapView.LayoutParams(-2, -2, localGeoPoint, 81));
        this.babypopview[i].setBackgroundDrawable(getResources().getDrawable(2130837518));
        this.babypopview[i].setPadding(0, 5, 0, 0);
        j = i;
        addView(i, this.hislistTime[paramInt] + "\n" + ((HistoryBean)this.hisAddList.get(i)).Address, false);
      }
    }
  }

  public void SetTimeByAddress(int paramInt)
  {
    if (this.currentViewNum != -10)
    {
      this.babypopview[this.currentViewNum].setBackgroundDrawable(getResources().getDrawable(2130837655));
      this.babypopview[this.currentViewNum].setPadding(0, 5, 0, 0);
    }
    GeoPoint localGeoPoint = new GeoPoint((int)(1000000.0D * Double.parseDouble(((HistoryBean)this.hisAddList.get(paramInt)).getLatitude())), (int)(1000000.0D * Double.parseDouble(((HistoryBean)this.hisAddList.get(paramInt)).getLongitude())));
    this.mMapView.removeView(this.babypopview[paramInt]);
    this.mMapView.addView(this.babypopview[paramInt], new MapView.LayoutParams(-2, -2, localGeoPoint, 81));
    this.babypopview[paramInt].setBackgroundDrawable(getResources().getDrawable(2130837518));
    this.babypopview[paramInt].setPadding(0, 5, 0, 0);
    addView(paramInt, ((HistoryBean)this.hisAddList.get(paramInt)).Address, false);
    this.babypopview[this.currentViewNum].setBackgroundDrawable(getResources().getDrawable(2130837518));
    this.babypopview[this.currentViewNum].setPadding(0, 5, 0, 0);
    this.currentViewNum = paramInt;
  }

  public String addLocationMode()
  {
    try
    {
      this.loc_bean = this.loginService.addLocationMode(this.username, "", "4", this.bid, this.pos, this);
      if (this.loc_bean.getCode().equals("0"))
        return "0";
      String str = this.loc_bean.getDesc();
      return str;
    }
    catch (IOException localIOException)
    {
      localIOException.printStackTrace();
      return null;
    }
    catch (XmlPullParserException localXmlPullParserException)
    {
      localXmlPullParserException.printStackTrace();
      return null;
    }
    catch (TimeOutException localTimeOutException)
    {
      localTimeOutException.printStackTrace();
      return null;
    }
    catch (NotFoundNetWorkException localNotFoundNetWorkException)
    {
      localNotFoundNetWorkException.printStackTrace();
    }
    return null;
  }

  public String getChildLocation()
  {
    new ArrayList();
    GetDateTime.getTime();
    List localList;
    int i;
    try
    {
      localList = this.loginService.getHistory(this.username, this.bid, GetDateTime.getDateTime(), this);
      i = -1 + localList.size();
      System.out.println("--childList Size信息长度-------------------\n\n" + i + "-----------------------------\n\n");
      if ((i < 0) || (i > localList.size()))
      {
        this.isFind = 0;
        return this.mLng + "," + this.mLat;
      }
    }
    catch (IOException localIOException)
    {
      localIOException.printStackTrace();
      this.isFind = -1;
      return this.mLng + "," + this.mLat;
    }
    catch (XmlPullParserException localXmlPullParserException)
    {
      localXmlPullParserException.printStackTrace();
      this.isFind = -1;
      return this.mLng + "," + this.mLat;
    }
    catch (TimeOutException localTimeOutException)
    {
      localTimeOutException.printStackTrace();
      this.isFind = -1;
      return this.mLng + "," + this.mLat;
    }
    catch (NotFoundNetWorkException localNotFoundNetWorkException)
    {
      localNotFoundNetWorkException.printStackTrace();
      this.isFind = -1;
      return this.mLng + "," + this.mLat;
    }
    this.isFind = 1;
    HistoryBean localHistoryBean = (HistoryBean)localList.get(i);
    localHistoryBean.getTimeSecond();
    String str1 = localHistoryBean.getLongitude();
    String str2 = localHistoryBean.getLatitude();
    String str3 = localHistoryBean.getUpdateTime();
    String str4 = localHistoryBean.getAddress();
    String str5 = str1 + "," + str2 + "," + str3 + "," + str4;
    System.out.println("------------------------boyLocation-----" + str5);
    return str5;
  }

  public List<HistoryBean> getListHisbean()
  {
    try
    {
      this.hisBeanList1 = this.loginService.getHistory(this.username, this.bid, this.timequery, this);
      System.out.println(this.hisBeanList1.size());
      if (this.hisBeanList1 == null)
        this.hisBeanList1 = new ArrayList();
      if ((this.hisBeanList1.size() > 0) && (this.babypoints.size() > 0))
      {
        this.babyPoints2 = this.babypoints;
        this.overList = new ArrayList();
        this.babypoints = new ArrayList();
      }
      i = 0;
      if (i >= this.hisBeanList1.size())
        return this.hisBeanList1;
    }
    catch (IOException localIOException)
    {
      while (true)
        localIOException.printStackTrace();
    }
    catch (XmlPullParserException localXmlPullParserException)
    {
      while (true)
        localXmlPullParserException.printStackTrace();
    }
    catch (TimeOutException localTimeOutException)
    {
      while (true)
        localTimeOutException.printStackTrace();
    }
    catch (NotFoundNetWorkException localNotFoundNetWorkException)
    {
      while (true)
      {
        int i;
        localNotFoundNetWorkException.printStackTrace();
        continue;
        GeoPoint localGeoPoint = new GeoPoint((int)(1000000.0D * Double.parseDouble(((HistoryBean)this.hisBeanList1.get(i)).getLatitude())), (int)(1000000.0D * Double.parseDouble(((HistoryBean)this.hisBeanList1.get(i)).getLongitude())));
        this.babypoints.add(localGeoPoint);
        i++;
      }
    }
  }

  protected boolean isRouteDisplayed()
  {
    return false;
  }

  public void onAnimationEnd(Animation paramAnimation)
  {
    if (paramAnimation.equals(this.animShow))
      showLocateItem();
    if ((paramAnimation.equals(this.animHide)) || (paramAnimation.equals(this.animSlowHide)))
    {
      System.out.println("hideLocateItem()");
      this.v_textview_locate_me.setVisibility(4);
      this.v_textview_locate_target.setVisibility(4);
      this.v_textview_locate_weixing.setVisibility(8);
    }
    if (paramAnimation.equals(this.listHide))
    {
      this.v_listview.setVisibility(4);
      this.v_imageshut.setVisibility(4);
    }
  }

  public void onAnimationRepeat(Animation paramAnimation)
  {
  }

  public void onAnimationStart(Animation paramAnimation)
  {
  }

  public void onClick(View paramView)
  {
    if (paramView.getId() == 2131493195)
      finish();
    label493: 
    do
    {
      return;
      if (paramView.getId() == 2131493196)
      {
        showLocateItemNow();
        return;
      }
      if (paramView.getId() == 2131493200)
      {
        animHideLocateItem();
        if (this.mMapView.isTraffic())
        {
          this.v_textview_locate_weixing.setText(getResources().getString(2131427977));
          this.mMapView.setSatellite(true);
          this.mMapView.setTraffic(false);
          return;
        }
        this.v_textview_locate_weixing.setText(getResources().getString(2131427976));
        this.mMapView.setTraffic(true);
        this.mMapView.setSatellite(false);
        return;
      }
      if (paramView.getId() == 2131493198)
      {
        int i;
        if ((this.babypoints != null) && (this.babypoints.size() > 0))
        {
          i = 0;
          if (i < this.hisAddList.size());
        }
        else
        {
          this.mMapView.removeView(this.ppview);
          this.mMapView.removeView(this.desView);
          this.v_listview.setVisibility(4);
          this.v_imageshut.setVisibility(4);
          this.mMapView.getOverlays().clear();
          this.hisBeanList = null;
          animHideLocateItem();
          if (this.myLocation == null)
            break label493;
          if (this.myLocation.getLatitude() != 4.9E-324D)
          {
            GeoPoint localGeoPoint2 = new GeoPoint((int)(1000000.0D * this.myLocation.getLatitude()), (int)(1000000.0D * this.myLocation.getLongitude()));
            this.mMapView.getController().animateTo(localGeoPoint2);
            this.mMapView.getOverlays().add(this.mLocationOverlay);
            if (this.desView != null)
              this.mMapView.removeView(this.desView);
            this.desView = getLayoutInflater().inflate(2130903171, null);
            this.mMapView.addView(this.desView, new MapView.LayoutParams(-2, -2, localGeoPoint2, 81));
            this.ppview = getLayoutInflater().inflate(2130903172, null);
            this.mMapView.addView(this.ppview, new MapView.LayoutParams(-2, -2, localGeoPoint2, 81));
            this.ppview.startAnimation(this.scale);
            TextView localTextView2 = (TextView)this.ppview.findViewById(2131493353);
            localTextView2.setVisibility(0);
            localTextView2.setText(getResources().getString(2131427974));
          }
        }
        while (true)
        {
          if (!isGPSEnable())
            switchGps();
          com.appwoo.txtws.component.Global.isManageGps = true;
          return;
          this.mMapView.removeView(this.babypopview[i]);
          i++;
          break;
          if (this.mBDLocation != null)
          {
            if (this.mBDLocation.getLatitude() != 4.9E-324D)
            {
              GeoPoint localGeoPoint1 = new GeoPoint((int)(1000000.0D * this.mBDLocation.getLatitude()), (int)(1000000.0D * this.mBDLocation.getLongitude()));
              this.mMapView.getController().animateTo(localGeoPoint1);
              this.mMapView.getOverlays().add(this.mLocationOverlay);
              if (this.desView != null)
                this.mMapView.removeView(this.desView);
              this.desView = getLayoutInflater().inflate(2130903171, null);
              this.mMapView.addView(this.desView, new MapView.LayoutParams(-2, -2, localGeoPoint1, 81));
              this.ppview = getLayoutInflater().inflate(2130903172, null);
              this.mMapView.addView(this.ppview, new MapView.LayoutParams(-2, -2, localGeoPoint1, 81));
              this.ppview.startAnimation(this.scale);
              TextView localTextView1 = (TextView)this.ppview.findViewById(2131493353);
              localTextView1.setVisibility(0);
              localTextView1.setText(getResources().getString(2131427974));
            }
            else
            {
              Toast.makeText(this, getString(2131427969), 1).show();
            }
          }
          else
            Toast.makeText(this, getString(2131427969), 1).show();
        }
      }
      if (paramView.getId() == 2131493199)
      {
        this.hisBeanList = null;
        animHideLocateItem();
        if (this.equipType.equals("Android"))
          new LocationAsyncTask().execute(new String[] { "location" });
        while (true)
        {
          this.linear_map_switch.setVisibility(8);
          this.linear_map_switch_close.setVisibility(0);
          return;
          Toast.makeText(this, getString(2131427970), 1).show();
        }
      }
      if (paramView.getId() == 2131493201)
      {
        this.v_listview.startAnimation(this.listHide);
        this.v_imageshut.startAnimation(this.listHide);
        return;
      }
      if (paramView.getId() == 2131493204)
      {
        this.linear_map_menu.setVisibility(0);
        this.linear_map_click.setVisibility(8);
        this.menuclick = (1 + this.menuclick);
        return;
      }
      if (paramView.getId() == 2131493206)
      {
        this.linear_map_menu.setVisibility(8);
        this.linear_map_click.setVisibility(0);
        this.menuclick = (1 + this.menuclick);
        return;
      }
      if (paramView.getId() == 2131493207)
      {
        Logger.d("xjf", "map ->开启模式");
        LocateWayDialog(this);
        return;
      }
      if (paramView.getId() == 2131493208)
      {
        Logger.d("xjf", "map ->关闭模式");
        new LocationAsyncTask().execute(new String[] { "close" });
        return;
      }
      if (paramView.getId() == 2131493209)
      {
        Logger.d("xjf", "map ->轨迹");
        showGuiji();
        return;
      }
      if (paramView.getId() == 2131493210)
      {
        Logger.d("xjf", "map ->按时间");
        if (this.hisBeanList == null)
        {
          new PopviewAsyncTask().execute(new String[] { "shijian" });
          return;
        }
        if ((this.timequery != null) && (this.timequery.equals(GetDateTime.getDate())))
        {
          new PopviewAsyncTask().execute(new String[] { "shijian" });
          return;
        }
        showShijian();
        return;
      }
    }
    while (paramView.getId() != 2131493211);
    Logger.d("xjf", "map ->按地点");
    if (this.hisBeanList == null)
    {
      new PopviewAsyncTask().execute(new String[] { "didian" });
      return;
    }
    if ((this.timequery != null) && (this.timequery.equals(GetDateTime.getDate())))
    {
      new PopviewAsyncTask().execute(new String[] { "didian" });
      return;
    }
    showDidian();
  }

  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setContentView(2130903135);
    init();
    RqSP localRqSP = new RqSP();
    this.bid = localRqSP.getLgDevId(this);
    this.username = localRqSP.getLgDevAccount(this);
    this.equipType = localRqSP.getLgDevType(this);
    this.loginService = new LoginService();
    startLocation();
    this.lBMapMan = new BMapManager(this);
    this.lBMapMan.init(getResources().getString(2131427328), new ServerAppBean.MyGeneralListener());
    super.initMapActivity(this.lBMapMan);
    this.mkSearch = new MKSearch();
    this.mMapView = ((MapView)findViewById(2131493197));
    this.mMapView.setBuiltInZoomControls(true);
    this.mMapView.setDrawOverlayWhenZooming(true);
    this.mMapView.setTraffic(true);
    this.mMapView.setSatellite(false);
    MKLocationManager localMKLocationManager = this.lBMapMan.getLocationManager();
    localMKLocationManager.enableProvider(1);
    localMKLocationManager.getLocationInfo();
    this.mMapController = this.mMapView.getController();
    this.mMapController.setZoom(18);
    this.mLocationListener = new LocationListener()
    {
      public void onLocationChanged(Location paramAnonymousLocation)
      {
        if (paramAnonymousLocation != null)
        {
          GeoPoint localGeoPoint = new GeoPoint((int)(1000000.0D * paramAnonymousLocation.getLatitude()), (int)(1000000.0D * paramAnonymousLocation.getLongitude()));
          TxtwebActivity.this.myLocation = paramAnonymousLocation;
          System.out.println(paramAnonymousLocation.getLatitude() + "   ,   " + paramAnonymousLocation.getLongitude() + "    , , , location1 ");
          if (TxtwebActivity.this.first == 1)
            TxtwebActivity.this.mMapView.getController().animateTo(localGeoPoint);
          TxtwebActivity.this.mMapView.invalidate();
          TxtwebActivity localTxtwebActivity = TxtwebActivity.this;
          localTxtwebActivity.first = (1 + localTxtwebActivity.first);
        }
      }
    };
    locaReg();
  }

  protected void onDestroy()
  {
    if (this.lBMapMan != null)
    {
      this.lBMapMan.destroy();
      this.lBMapMan = null;
    }
    if (this.mLocationListener != null)
      this.mLocationListener = null;
    if (this.mLocationOverlay != null)
      this.mLocationOverlay = null;
    if (isGPSEnable())
      switchGps();
    com.appwoo.txtws.component.Global.isManageGps = false;
    if ((this.mLocationClient != null) && (this.mLocationClient.isStarted()))
    {
      this.mLocationClient.stop();
      this.mLocationClient = null;
    }
    super.onDestroy();
  }

  public void onItemClick(AdapterView<?> paramAdapterView, View paramView, int paramInt, long paramLong)
  {
    System.out.println(-1 + this.hisBeanList.size() - paramInt + "  weizhi" + ((HistoryBean)this.hisBeanList.get(-1 + this.hisBeanList.size() - paramInt)).getUpdateTime() + "   " + ((HistoryBean)this.hisBeanList.get(-1 + this.hisBeanList.size() - paramInt)).getLatitude() + " " + ((HistoryBean)this.hisBeanList.get(-1 + this.hisBeanList.size() - paramInt)).getLongitude());
    this.mMapView.getOverlays().remove(this.myLocation);
    GeoPoint localGeoPoint = new GeoPoint((int)(1000000.0D * Double.parseDouble(((HistoryBean)this.hisBeanList.get(-1 + this.hisBeanList.size() - paramInt)).getLatitude())), (int)(1000000.0D * Double.parseDouble(((HistoryBean)this.hisBeanList.get(-1 + this.hisBeanList.size() - paramInt)).getLongitude())));
    this.overlayItem = new OverlayItem(localGeoPoint, "", "");
    SetAddressByTime(paramInt);
    this.mMapController.animateTo(localGeoPoint);
  }

  public boolean onKeyDown(int paramInt, KeyEvent paramKeyEvent)
  {
    if (paramInt == 82)
    {
      if (this.menuclick % 2 == 1)
      {
        this.linear_map_menu.setVisibility(0);
        this.linear_map_click.setVisibility(8);
      }
      while (true)
      {
        this.menuclick = (1 + this.menuclick);
        return true;
        this.linear_map_menu.setVisibility(8);
        this.linear_map_click.setVisibility(0);
      }
    }
    if (paramInt == 4)
    {
      if (this.linear_map_menu.getVisibility() == 0)
      {
        this.linear_map_menu.setVisibility(8);
        this.linear_map_click.setVisibility(0);
        this.menuclick = (1 + this.menuclick);
        return false;
      }
      if (!isExit)
      {
        isExit = true;
        Toast.makeText(this, getString(2131427971), 0).show();
        this.tExit.postDelayed(this.task, 2000L);
        return false;
      }
      return super.onKeyDown(paramInt, paramKeyEvent);
    }
    return super.onKeyDown(paramInt, paramKeyEvent);
  }

  protected void onPause()
  {
    super.onPause();
  }

  protected void onResume()
  {
    isExit = false;
    super.onResume();
  }

  public boolean onTouch(View paramView, MotionEvent paramMotionEvent)
  {
    switch (paramMotionEvent.getAction())
    {
    default:
    case 0:
    case 1:
    }
    while (true)
    {
      return false;
      float f = paramMotionEvent.getX();
      paramMotionEvent.getY();
      System.out.println(f + "  a1");
      continue;
      System.out.println(paramMotionEvent.getX() + " xpy " + 0.0F);
      this.mMapController.scrollBy((int)paramMotionEvent.getX(), (int)paramMotionEvent.getY());
    }
  }

  public void refreshMapView(String paramString)
  {
    this.v_listview.setVisibility(4);
    this.v_imageshut.setVisibility(4);
    this.dLng = Double.parseDouble(paramString.split(",")[0]);
    this.dLat = Double.parseDouble(paramString.split(",")[1]);
    this.mkSearch.reverseGeocode(new GeoPoint((int)(1000000.0D * this.dLat), (int)(1000000.0D * this.dLng)));
    if (this.isFind == 0)
    {
      Toast.makeText(this, getString(2131427967), 1).show();
      return;
    }
    if (this.isFind == -1)
    {
      Toast.makeText(this, getString(2131427525), 0).show();
      return;
    }
    String[] arrayOfString = paramString.split(",");
    String str1 = paramString.split(",")[2];
    String str2 = "";
    if (arrayOfString.length > 3)
      str2 = paramString.split(",")[3];
    this.mMapView.removeView(this.desView);
    this.mMapView.removeView(this.ppview);
    this.mMapView.getOverlays().clear();
    if ((this.babypoints != null) && (this.babypoints.size() > 0));
    for (int i = 0; ; i++)
    {
      if (i >= this.hisAddList.size())
      {
        final GeoPoint localGeoPoint = new GeoPoint((int)(1000000.0D * this.dLat), (int)(1000000.0D * this.dLng));
        this.desView = getLayoutInflater().inflate(2130903171, null);
        this.mMapView.addView(this.desView, new MapView.LayoutParams(-2, -2, localGeoPoint, 81));
        this.ppview = getLayoutInflater().inflate(2130903172, null);
        this.mMapView.addView(this.ppview, new MapView.LayoutParams(-2, -2, localGeoPoint, 81));
        this.ppview.startAnimation(this.scale);
        TextView localTextView = (TextView)this.ppview.findViewById(2131493353);
        localTextView.setVisibility(0);
        localTextView.setText(getResources().getString(2131427975) + "\n" + str1 + "\n" + str2);
        this.mMapController.animateTo(localGeoPoint);
        this.desView.setOnClickListener(new View.OnClickListener()
        {
          public void onClick(View paramAnonymousView)
          {
            TxtwebActivity.this.ppview.startAnimation(TxtwebActivity.this.scale);
            TxtwebActivity.this.mMapView.addView(TxtwebActivity.this.ppview, new MapView.LayoutParams(-2, -2, localGeoPoint, 81));
          }
        });
        this.mMapView.getOverlays().add(new QiziOverlay(this.marker, this));
        return;
      }
      this.mMapView.removeView(this.babypopview[i]);
    }
  }

  public String rqLocation()
  {
    Object localObject = "5";
    WebService localWebService = new WebService();
    try
    {
      StateBean localStateBean = localWebService.isAddLocation(this.username, this.bid, this);
      if (localStateBean.getType() != null)
      {
        String str = localStateBean.getType();
        localObject = str;
      }
      return localObject;
    }
    catch (IOException localIOException)
    {
      localIOException.printStackTrace();
      return localObject;
    }
    catch (XmlPullParserException localXmlPullParserException)
    {
      localXmlPullParserException.printStackTrace();
      return localObject;
    }
    catch (TimeOutException localTimeOutException)
    {
      localTimeOutException.printStackTrace();
      return localObject;
    }
    catch (NotFoundNetWorkException localNotFoundNetWorkException)
    {
      localNotFoundNetWorkException.printStackTrace();
    }
    return localObject;
  }

  public void showDidian()
  {
    new ArrayList();
    if ((this.hisBeanList != null) && (this.hisBeanList.size() > 0))
    {
      this.hislistAddress = new String[this.hisAddList.size()];
      for (int i = 0; ; i++)
      {
        if (i >= this.hisAddList.size())
        {
          AlertDialog.Builder localBuilder = new AlertDialog.Builder(new ContextThemeWrapper(this, 2131361821));
          localBuilder.setTitle(getString(2131427981));
          localBuilder.setItems(this.hislistAddress, new DialogInterface.OnClickListener()
          {
            public void onClick(DialogInterface paramAnonymousDialogInterface, int paramAnonymousInt)
            {
              GeoPoint localGeoPoint = new GeoPoint((int)(1000000.0D * Double.parseDouble(((HistoryBean)TxtwebActivity.this.hisAddList.get(paramAnonymousInt)).getLatitude())), (int)(1000000.0D * Double.parseDouble(((HistoryBean)TxtwebActivity.this.hisAddList.get(paramAnonymousInt)).getLongitude())));
              TxtwebActivity.this.overlayItem = new OverlayItem(localGeoPoint, "", "");
              TxtwebActivity.this.SetTimeByAddress(paramAnonymousInt);
              TxtwebActivity.this.mMapController.animateTo(localGeoPoint);
              paramAnonymousDialogInterface.dismiss();
            }
          });
          localBuilder.create().show();
          return;
        }
        String str1 = ((HistoryBean)this.hisAddList.get(i)).Address;
        String str2 = ((HistoryBean)this.hisAddList.get(i)).UpdateTime;
        if (str1.length() > 17)
          str1 = str1.substring(0, 17);
        if (str2.length() > 18)
          str2 = str2.substring(0, 18) + "...";
        System.out.println(str1 + " address  ,  update  " + str2);
        this.hislistAddress[i] = (str1 + "\n" + str2);
      }
    }
    Toast.makeText(this, "(" + this.timequery + ")" + getString(2131427968), 1).show();
  }

  public void showGuiji()
  {
    Calendar localCalendar = Calendar.getInstance();
    int i = localCalendar.get(1);
    int j = localCalendar.get(2);
    int k = localCalendar.get(5);
    LinearLayout localLinearLayout = (LinearLayout)getLayoutInflater().inflate(2130903218, null);
    final TextView localTextView = (TextView)localLinearLayout.findViewById(2131493571);
    DatePicker localDatePicker = (DatePicker)localLinearLayout.findViewById(2131493570);
    String str1;
    if (j + 1 < 10)
    {
      str1 = "0" + (j + 1);
      if (k >= 10)
        break label292;
    }
    label292: for (String str2 = "0" + k; ; str2 = k)
    {
      localTextView.setText(i + "-" + str1 + "-" + str2);
      localDatePicker.init(localCalendar.get(1), localCalendar.get(2), localCalendar.get(5), new DatePicker.OnDateChangedListener()
      {
        public void onDateChanged(DatePicker paramAnonymousDatePicker, int paramAnonymousInt1, int paramAnonymousInt2, int paramAnonymousInt3)
        {
          String str1;
          if (paramAnonymousInt2 + 1 < 10)
          {
            str1 = "0" + (paramAnonymousInt2 + 1);
            if (paramAnonymousInt3 >= 10)
              break label117;
          }
          label117: for (String str2 = "0" + paramAnonymousInt3; ; str2 = paramAnonymousInt3)
          {
            localTextView.setText(paramAnonymousInt1 + "-" + str1 + "-" + str2);
            return;
            str1 = paramAnonymousInt2 + 1;
            break;
          }
        }
      });
      this.dialogquery = new AlertDialog.Builder(this);
      this.dialogquery.setView(localLinearLayout);
      this.dialogquery.setPositiveButton(getString(2131427513), new DialogInterface.OnClickListener()
      {
        public void onClick(DialogInterface paramAnonymousDialogInterface, int paramAnonymousInt)
        {
          TxtwebActivity.this.mMapView.getOverlays().clear();
          if (TxtwebActivity.this.hisBeanList != null)
            TxtwebActivity.this.hisBeanList.clear();
          TxtwebActivity.this.v_listview.setVisibility(4);
          TxtwebActivity.this.v_imageshut.setVisibility(4);
          TxtwebActivity.this.mMapView.removeView(TxtwebActivity.this.desView);
          TxtwebActivity.this.timequery = localTextView.getText().toString();
          new TxtwebActivity.PopviewAsyncTask(TxtwebActivity.this).execute(new String[] { "popviewshow" });
          if (!TxtwebActivity.this.isGPSEnable())
            TxtwebActivity.this.switchGps();
          com.appwoo.txtws.component.Global.isManageGps = true;
        }
      });
      this.dialogquery.setNegativeButton(getString(2131427514), new DialogInterface.OnClickListener()
      {
        public void onClick(DialogInterface paramAnonymousDialogInterface, int paramAnonymousInt)
        {
        }
      });
      this.dialogquery.show();
      return;
      str1 = j + 1;
      break;
    }
  }

  public void showShijian()
  {
    if ((this.hisBeanList != null) && (this.hisBeanList.size() > 0))
    {
      this.v_listview.setVisibility(0);
      this.v_imageshut.setVisibility(0);
      ArrayAdapter localArrayAdapter = new ArrayAdapter(this, 2130903221, this.hislistTime);
      this.v_listview.setAdapter(localArrayAdapter);
      this.v_imageshut.setOnClickListener(this);
      this.v_listview.setOnItemClickListener(this);
      return;
    }
    Toast.makeText(this, getString(2131427965), 1).show();
  }

  public void startLocation()
  {
    this.mLocationClient = new LocationClient(this);
    LocationClientOption localLocationClientOption = new LocationClientOption();
    localLocationClientOption.setOpenGps(true);
    localLocationClientOption.setCoorType("bd09ll");
    localLocationClientOption.setPriority(2);
    localLocationClientOption.setProdName("locSDKDemo2");
    localLocationClientOption.setScanSpan(5000);
    this.mLocationClient.setLocOption(localLocationClientOption);
    this.mLocationClient.registerLocationListener(new BDLocationListener()
    {
      public void onReceiveLocation(BDLocation paramAnonymousBDLocation)
      {
        if (paramAnonymousBDLocation == null)
          return;
        StringBuffer localStringBuffer = new StringBuffer(256);
        localStringBuffer.append("time : ");
        localStringBuffer.append(paramAnonymousBDLocation.getTime());
        localStringBuffer.append("\nerror code : ");
        localStringBuffer.append(paramAnonymousBDLocation.getLocType());
        localStringBuffer.append("\nlatitude : ");
        localStringBuffer.append(paramAnonymousBDLocation.getLatitude());
        localStringBuffer.append("\nlontitude : ");
        localStringBuffer.append(paramAnonymousBDLocation.getLongitude());
        localStringBuffer.append("\nradius : ");
        localStringBuffer.append(paramAnonymousBDLocation.getRadius());
        if (paramAnonymousBDLocation.getLocType() == 61)
        {
          localStringBuffer.append("\nspeed : ");
          localStringBuffer.append(paramAnonymousBDLocation.getSpeed());
          localStringBuffer.append("\nsatellite : ");
          localStringBuffer.append(paramAnonymousBDLocation.getSatelliteNumber());
        }
        while (true)
        {
          localStringBuffer.append("\nsdk version : ");
          Logger.i("lin5", "定位:" + localStringBuffer.toString());
          TxtwebActivity.this.mBDLocation = paramAnonymousBDLocation;
          return;
          if (paramAnonymousBDLocation.getLocType() == 161)
          {
            localStringBuffer.append("\naddr : ");
            localStringBuffer.append(paramAnonymousBDLocation.getAddrStr());
          }
        }
      }

      public void onReceivePoi(BDLocation paramAnonymousBDLocation)
      {
      }
    });
    this.mLocationClient.start();
  }

  public void switchLocalMode(String paramString)
  {
    if (paramString.equals("4"))
    {
      new LocationAsyncTask().execute(new String[] { "open" });
      return;
    }
    new LocationAsyncTask().execute(new String[] { "close" });
  }

  public class LocationAsyncTask extends AsyncTask<String, Integer, String>
  {
    private String method = "";
    private ProgressDialog v_progressDialog;

    public LocationAsyncTask()
    {
    }

    protected String doInBackground(String[] paramArrayOfString)
    {
      this.method = paramArrayOfString[0];
      if (this.method.equals("location"))
        return TxtwebActivity.this.getChildLocation();
      if (this.method.equals("open"))
        return TxtwebActivity.this.addCMD("4", TxtwebActivity.this.username, "", TxtwebActivity.this.bid);
      if (this.method.equals("close"))
        return TxtwebActivity.this.addCMD("5", TxtwebActivity.this.username, "", TxtwebActivity.this.bid);
      if (this.method.equals("islocation"))
        return TxtwebActivity.this.rqLocation();
      if (this.method.equals("locationmode"))
        return TxtwebActivity.this.addLocationMode();
      return "0";
    }

    protected void onPostExecute(String paramString)
    {
      if (this.method.equals("location"))
      {
        TxtwebActivity.this.refreshMapView(paramString);
        TxtwebActivity.this.hideLocateItem();
      }
      if (this.method.equals("open"))
      {
        if (!paramString.equals("0"))
          break label253;
        TxtwebActivity.this.linear_map_switch.setVisibility(8);
        TxtwebActivity.this.linear_map_switch_close.setVisibility(0);
        TxtwebActivity.isOpen = true;
      }
      while (true)
      {
        if (this.method.equals("close"))
        {
          if (paramString.equals("0"))
          {
            TxtwebActivity.this.linear_map_switch.setVisibility(0);
            TxtwebActivity.this.linear_map_switch_close.setVisibility(8);
            TxtwebActivity.isOpen = false;
          }
        }
        else
        {
          label123: if (this.method.equals("islocation"))
          {
            if (!paramString.equals("4"))
              break label283;
            TxtwebActivity.this.linear_map_switch.setVisibility(8);
            TxtwebActivity.this.linear_map_switch_close.setVisibility(0);
            TxtwebActivity.isOpen = true;
          }
          label171: if (this.method.equals("locationmode"))
          {
            if (!paramString.equals("0"))
              break label339;
            Toast.makeText(TxtwebActivity.this, TxtwebActivity.this.getString(2131427435), 0).show();
            TxtwebActivity.isOpen = true;
            if (!TxtwebActivity.isOpen)
              break label313;
            TxtwebActivity.this.linear_map_switch.setVisibility(8);
            TxtwebActivity.this.linear_map_switch_close.setVisibility(0);
          }
        }
        try
        {
          while (true)
          {
            this.v_progressDialog.dismiss();
            return;
            label253: Toast.makeText(TxtwebActivity.this, paramString, 1).show();
            break;
            Toast.makeText(TxtwebActivity.this, paramString, 1).show();
            break label123;
            label283: TxtwebActivity.this.linear_map_switch.setVisibility(0);
            TxtwebActivity.this.linear_map_switch_close.setVisibility(8);
            TxtwebActivity.isOpen = false;
            break label171;
            label313: TxtwebActivity.this.linear_map_switch.setVisibility(0);
            TxtwebActivity.this.linear_map_switch_close.setVisibility(8);
            continue;
            label339: Toast.makeText(TxtwebActivity.this, paramString, 0).show();
          }
        }
        catch (Exception localException)
        {
        }
      }
    }

    protected void onPreExecute()
    {
      if ((this.v_progressDialog == null) || (!this.v_progressDialog.isShowing()))
      {
        this.v_progressDialog = new ProgressDialog(TxtwebActivity.this);
        this.v_progressDialog.setMessage(TxtwebActivity.this.getString(2131427516));
        this.v_progressDialog.setCancelable(false);
        this.v_progressDialog.show();
      }
    }

    protected void onProgressUpdate(Integer[] paramArrayOfInteger)
    {
    }
  }

  public class MyGeneralListener
    implements MKGeneralListener
  {
    public MyGeneralListener()
    {
    }

    public void onGetNetworkState(int paramInt)
    {
      Toast.makeText(TxtwebActivity.this, "您的网络出错啦！", 1).show();
    }

    public void onGetPermissionState(int paramInt)
    {
      if (paramInt == 300)
        Toast.makeText(TxtwebActivity.this, "请在BMapApiDemoApp.java文件输入正确的授权Key！", 1).show();
    }
  }

  public class MySearchListener
    implements MKSearchListener
  {
    public MySearchListener()
    {
    }

    public void onGetAddrResult(MKAddrInfo paramMKAddrInfo, int paramInt)
    {
      if (paramMKAddrInfo == null)
      {
        System.out.println("result = null ");
        return;
      }
      MKGeocoderAddressComponent localMKGeocoderAddressComponent = paramMKAddrInfo.addressComponents;
      new StringBuilder("  ").append(localMKGeocoderAddressComponent.province).append(" , ").append(localMKGeocoderAddressComponent.city).append(" , ").append(localMKGeocoderAddressComponent.district).append(" , ").append(localMKGeocoderAddressComponent.street).append(" , ").append(localMKGeocoderAddressComponent.streetNumber).toString();
      TxtwebActivity.this.sb = new StringBuffer();
      TxtwebActivity.this.sb.append(paramMKAddrInfo.strAddr);
      TxtwebActivity.this.map_adress.setText(TxtwebActivity.this.sb);
    }

    public void onGetBusDetailResult(MKBusLineResult paramMKBusLineResult, int paramInt)
    {
    }

    public void onGetDrivingRouteResult(MKDrivingRouteResult paramMKDrivingRouteResult, int paramInt)
    {
    }

    public void onGetPoiResult(MKPoiResult paramMKPoiResult, int paramInt1, int paramInt2)
    {
      if ((paramInt2 != 0) || (paramMKPoiResult == null))
        Toast.makeText(TxtwebActivity.this, TxtwebActivity.this.getString(2131428226), 1).show();
      while ((paramMKPoiResult == null) || (paramMKPoiResult.getCurrentNumPois() <= 0))
        return;
      GeoPoint localGeoPoint = ((MKPoiInfo)paramMKPoiResult.getAllPoi().get(0)).pt;
      TxtwebActivity.this.mMapView.getController().animateTo(localGeoPoint);
      Object[] arrayOfObject = new Object[2];
      arrayOfObject[0] = Double.valueOf(localGeoPoint.getLatitudeE6() / 1000000.0D);
      arrayOfObject[1] = Double.valueOf(localGeoPoint.getLongitudeE6() / 1000000.0D);
      String str = String.format("纬度：%f 经度：%f\r\n", arrayOfObject) + "\r\n附近有：";
      for (int i = 0; ; i++)
      {
        if (i >= paramMKPoiResult.getAllPoi().size())
        {
          Toast.makeText(TxtwebActivity.this, str, 1).show();
          return;
        }
        str = str + ((MKPoiInfo)paramMKPoiResult.getAllPoi().get(i)).name + ";";
      }
    }

    public void onGetRGCShareUrlResult(String paramString, int paramInt)
    {
    }

    public void onGetSuggestionResult(MKSuggestionResult paramMKSuggestionResult, int paramInt)
    {
    }

    public void onGetTransitRouteResult(MKTransitRouteResult paramMKTransitRouteResult, int paramInt)
    {
    }

    public void onGetWalkingRouteResult(MKWalkingRouteResult paramMKWalkingRouteResult, int paramInt)
    {
    }
  }

  public class PopviewAsyncTask extends AsyncTask<String, R.integer, List<HistoryBean>>
  {
    private String method = "";
    private ProgressDialog v_progressDialog;

    public PopviewAsyncTask()
    {
    }

    protected List<HistoryBean> doInBackground(String[] paramArrayOfString)
    {
      this.method = paramArrayOfString[0];
      if (this.method.equals("popviewshow"))
        return TxtwebActivity.this.getListHisbean();
      if (this.method.equals("shijian"))
      {
        if (TxtwebActivity.this.timequery == null)
          TxtwebActivity.this.timequery = GetDateTime.getDate();
        return TxtwebActivity.this.getListHisbean();
      }
      if (this.method.equals("didian"))
      {
        if (TxtwebActivity.this.timequery == null)
          TxtwebActivity.this.timequery = GetDateTime.getDate();
        return TxtwebActivity.this.getListHisbean();
      }
      return null;
    }

    protected void onPostExecute(List<HistoryBean> paramList)
    {
      if (this.method.equals("popviewshow"))
        TxtwebActivity.this.getHistory(paramList);
      if (this.method.equals("shijian"))
        TxtwebActivity.this.getTimeHistory(paramList);
      if (this.method.equals("didian"))
        TxtwebActivity.this.getAddressHistory(paramList);
      TxtwebActivity.this.mMapView.getOverlays().add(new TxtwebActivity.QiziOverlay(TxtwebActivity.this, TxtwebActivity.this.marker, TxtwebActivity.this));
      this.v_progressDialog.dismiss();
    }

    protected void onPreExecute()
    {
      if ((this.v_progressDialog == null) || (!this.v_progressDialog.isShowing()))
      {
        this.v_progressDialog = new ProgressDialog(TxtwebActivity.this);
        this.v_progressDialog.setMessage(TxtwebActivity.this.getString(2131427516));
        this.v_progressDialog.setCancelable(false);
        this.v_progressDialog.show();
      }
    }

    protected void onProgressUpdate(R.integer[] paramArrayOfinteger)
    {
    }
  }

  public class QiziOverlay extends ItemizedOverlay<OverlayItem>
  {
    private Context mContext;
    Drawable marker;

    public QiziOverlay(Drawable paramContext, Context arg3)
    {
      super();
      this.marker = paramContext;
      Object localObject;
      this.mContext = localObject;
      populate();
    }

    protected OverlayItem createItem(int paramInt)
    {
      return (OverlayItem)TxtwebActivity.this.overList.get(paramInt);
    }

    public void draw(Canvas paramCanvas, MapView paramMapView, boolean paramBoolean)
    {
      super.draw(paramCanvas, paramMapView, paramBoolean);
    }

    public boolean onTap(GeoPoint paramGeoPoint, MapView paramMapView)
    {
      TxtwebActivity.this.map_adress.setVisibility(4);
      TxtwebActivity.this.mMapView.removeView(TxtwebActivity.this.ppview);
      return super.onTap(paramGeoPoint, paramMapView);
    }

    public int size()
    {
      return TxtwebActivity.this.overList.size();
    }
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.activity.TxtwebActivity
 * JD-Core Version:    0.6.2
 */